import Vue from 'vue'
import Router from 'vue-router'
import login from './views/login'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:'login'
    },
    {
      path: '/',
      meta:{auth:true},
      component:(resolve) => require(['./views/Home'], resolve),
      children:[{
          path:'/mainPage',
          component:(resolve) => require(['./views/mainPage'], resolve),
          meta: { title: '图文列表' }
      },
      {
        path:'/List',
        component:(resolve) => require(['./views/List'], resolve),
        meta: { title: '详情' }
    },
    ]
    },
    {
      path: '/login',
      component:login
    }
  ],
})
